<?php

class Account_OauthController extends Ext_Controller_Action_Front
{
    public function init()
    {
        parent::init();
    }
    
    public function indexAction()
    {
    }

    public function showFormAction()
    {
        $adapter = $this->_request->get('adapter');
        
        $oauth = new Ext_Oauth_Login();
        $oauth->setAdapter($adapter);
        if(!$oauth->hasOauth()){
            $oauth->setOauth();
        }
        
        if($oauth->hasBind()){
            $this->_redirect('/');
        }
        
        $adapter = new Ext_Oauth_Login_ShowForm_Adapter();
        $this->view->formLogin    = $adapter->showLoginForm($oauth->getOauthResult());
        $this->view->formRegister = $adapter->showRegisterForm($oauth->getOauthResult());
    }
}

